function fc_get_db_path(p_db){
  file_path=window.document.location.href.substring(8);//去除files:///
  file_path=file_path.substring(0,file_path.lastIndexOf("/"));//去除檔案名稱
  
  while(file_path.indexOf("%20")>=0){
    file_path=file_path.replace("%20"," ");
  }
  
  return file_path + "/" + p_db; 
}

function fc_open_db(){
	con = new ActiveXObject("ADODB.Connection");
  
  try{
  	con.open("Driver=SQLite3 ODBC Driver;Database=" + fc_get_db_path(data_db_name) + ";");
  }
  catch(E){
  	alert("無法開啟資料庫" + fc_get_db_path(data_db_name) + "在dao.fc_open_db() Error message:" + E.message);
  }
}

function fc_close_db(){
	try{
		con.close();
	}
	catch(E){
		alert("無法關閉資料庫連線在dao.fc_close_db() Error message:" + E.message);
	}
	
	con=null;
}